package by.dezhits.liltweets;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

public class StartActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start);
		SharedPreferences prefs = getApplicationContext().getSharedPreferences(
				getString(R.string.user_details), MODE_PRIVATE);
		if (prefs.getBoolean(getString(R.string.logged), false)){
			Intent intent = new Intent(StartActivity.this, FragmentsActivity.class);
			startActivity(intent);
		}
		else{
			Intent intent = new Intent(StartActivity.this, LoginActivity.class);
			startActivity(intent);
		}
		finish();
	}
}
